import wx

class Example(wx.Frame):
    def __init__(self, parent, title):
        super(Example, self).__init__(parent, title=title, size=(350,250))
        self.Center() # 加这行就居中了。
def main():
    app = wx.App()
    frame = Example(None, title='窗口居中')
    frame.Show()
    app.MainLoop()

if __name__ == '__main__':
    main()
